<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <head>
        <link rel="stylesheet" href="/plugins/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
        <link rel="stylesheet" href="/dist/css/ionicons.min.css">
        <link rel="stylesheet" href="/dist/css/AdminLTE.css">
        <link rel="stylesheet" href="/dist/css/skins/_all-skins.min.css">
        <!-- 以上为公共css -->

        <link rel="stylesheet" href="/plugins/iCheck/flat/_all.css">
    </head>
    <style>
        .form-horizontal {
            padding-top: 15px;
        }

        .vail_err {
            position: absolute;
            color: red;
            right: -9%;
            bottom: 28%;
        }
    </style>
</head>
<body>
<form class="form-horizontal" id="form">
    <div class="form-group">
        <label class="col-sm-2 control-label">姓名</label>
        <div class="col-sm-3">
            <input class="form-control" type="text" placeholder="姓名" name="name">
        </div>

        <label class="col-sm-2 control-label">年龄</label>
        <div class="col-sm-3">
            <input class="form-control" type="text" placeholder="年龄">
        </div>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label">id</label>
        <div class="col-sm-2">
            <input class="form-control" type="text" placeholder="id" name="id">
        </div>

        <label class="col-sm-1 control-label">内容</label>
        <div class="col-sm-2">
            <input class="form-control" type="text" placeholder="内容" name="content">
        </div>

        <label class="col-sm-2 control-label">年龄</label>
        <div class="col-sm-2">
            <input class="form-control" placeholder="年龄">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">描述</label>
        <div class="col-sm-9">
            <input class="form-control" placeholder="描述">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">姓名</label>
        <div class="col-sm-5">
            <textarea class="form-control" rows="3"></textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">爱好</label>
        <div class="col-sm-2">
            <select class="form-control" name="age">
                <option value="">未知</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
                <option value="5">5</option>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">单选</label>
        <div class="col-sm-4">
            <label class="checkbox-inline">
                <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
            </label>
            <label class="checkbox-inline">
                <input type="checkbox" id="inlineCheckbox2" value="option2"> 2
            </label>
            <label class="checkbox-inline">
                <input type="checkbox" id="inlineCheckbox3" value="option3"> 3
            </label>
        </div>

        <label class="col-sm-1 control-label">多选</label>
        <div class="col-sm-5">
            <label class="radio-inline">
                <input type="radio" name="radio" id="inlineRadio1" value="option1"> 1
            </label>
            <label class="radio-inline">
                <input type="radio" name="radio" id="inlineRadio2" value="option2"> 2
            </label>
            <label class="radio-inline">
                <input type="radio" name="radio" id="inlineRadio3" value="option3"> 3
            </label>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input type="submit" class="btn btn-primary submitBtn" value="保存">
        </div>
    </div>
</form>

</body>
<script src="/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="/plugins/jQuery/jquery.cookie.js"></script>
<script src="/plugins/jQuery/jquery.form.min.js"></script>
<script src="/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="/plugins/layer/layer.js"></script>
<script src="/plugins/laypage/laypage.js"></script>
<script src="/plugins/iCheck/icheck.min.js"></script>
<script src="/static/js/core.js"></script>
<script src="/static/js/core.ajax.js"></script>
<script src="/static/js/core.databind.js"></script>

<!--保存需要-->
<script src="/plugins/jQuery/jquery.validate.js"></script>
<script src="/plugins/jQuery/messages_zh.min.js"></script>
<script src="/static/js/core.validation.js"></script>
<script>
    var is_need_login = true;
    var id = Comm.Request("id");

    if (id) {
        BindData.bindview({url: "/table/get", data: {id: id}});
    }

    var data = {};
    /*  data.a = "1";
        data.b = "2";*/

    Validation({
        post_form: {
            post_url: "/table/save", edit_url: "/table/update",
            data: data,
            callbackFunc: function (d) {
                layer.msg(d.msg, {
                    icon: 1,
                    time: 1000 //1秒关闭（默认3秒）
                }, function () {
                    Method("page");
                    close();
                });
            }
        },
        rules: {
            name: {required: true},
            content: {required: true},
            age: {required: true}
        }
    });
</script>
</html>